<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-3.1.1.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title></title>
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/frame/layui/css/layui.css">
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/frame/static/css/styles.css">
<link rel="icon"
	href="<%=request.getContextPath()%>/frame/static/image/code.png">
</head>
<body>
<form class="layui-form layui-form-pane" action="<%=request.getContextPath()%>/manager/mUserUpdate" method="post">

	<input type="hidden" value="${user.userId }" name="userId">
	
    <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>

        <div class="layui-input-inline">
            <input type="text" name="userName" value="${user.userName }" lay-verify="required" placeholder="请输入用户名" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">真实姓名</label>

        <div class="layui-input-inline">
            <input type="text" name="realName" value="${user.realName }" lay-verify="required" placeholder="请输入真实姓名" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>

        <div class="layui-input-inline">
            <input type="text" name="password" value="${user.password }" placeholder="请输入密码" autocomplete="off" class="layui-input">
        </div>
        <!-- <div class="layui-form-mid layui-word-aux">请务必填写用户名</div> -->
    </div>


	  <div class="layui-form-item">    
        
        <label class="layui-form-label">身份</label>
        <div class="layui-input-inline">
            <select name="singer">
                <option value="">请选择</option>
                <option value="1" <c:if test="${user.singer== 1}"> selected="selected"</c:if>>音乐人</option>
                <option value="0" <c:if test="${user.singer== 0}"> selected="selected"</c:if>>普通用户</option>
                <option value="2" <c:if test="${user.singer== 2}"> selected="selected"</c:if>>待审核</option>
                
            </select>
        </div> 
      </div>
 
   <!-- <div class="layui-form-item layui-form-text">
        <div class="layui-input-block">
            <textarea id="LAY_demo_editor" placeholder="请输入内容" class="layui-textarea"></textarea>
        </div>
        <label class="layui-form-label">请输入内容</label>
    </div> -->
    <div class="layui-form-item">
        <button class="layui-btn" type="submit" lay-filter="sub">提交</button>
    </div> 
</form>


<script src="<%=request.getContextPath()%>/frame/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript">
    layui.use(['form', 'layedit', 'laydate', 'element'], function () {
        var form = layui.form
                , layer = layui.layer
                , layedit = layui.layedit
                , laydate = layui.laydate
                , element = layui.element;

        //创建一个编辑器
        var editIndex = layedit.build('LAY_demo_editor');

        //自定义验证规则
        form.verify({
            title: function (value) {
                if (value.length < 5) {
                    return '标题至少得5个字符啊';
                }
            }
            , pass: [/(.+){6,12}$/, '密码必须6到12位']
            , content: function (value) {
                layedit.sync(editIndex);
            }
        });

        //监听提交
        form.on('submit(sub)', function (data) {
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            });
            return false;
        });

        // you code ...


    });
</script>
</body>
</html>